﻿@model Tippelde.Web.Models.Bet.CompetitionTableModel
@{
    ViewBag.Title = Model.Table != null ? Model.Table.Group.Name : "Tabellák";
}

<div class="row">
    @Html.ValidationSummary()
    <div class="col-md-3">
        <h3>Csoportok</h3>
        <ul class="nav nav-pills nav-stacked">
            @foreach (var group in Model.Groups)
            {
                <li class="@(Model.Table!=null && Model.Table.Group.Id==group.Id ? "active" : "")"><a href="@Url.Action("Index","Bet",new {Id=group.Id})">@group.Name</a></li>
            }
        </ul>
    </div>

    <div class="col-md-9">
        @if (Model.Table != null)
        {
            <h3>@Model.Table.Group.Name - Tabella</h3>
            <table class="table table-striped table-hover">
                <tbody>
                    @for (var i = 0; i < Model.Table.Result.Count; i++)
                    {
                        <tr class="@(User.Identity.Name==Model.Table.Result[i].User.UserName ? "current-user": "")">
                            <td>
                                @(i + 1)
                            </td>
                            <td>
                                @Model.Table.Result[i].User.FullName
                            </td>
                            <td>
                                @Model.Table.Result[i].Points
                            </td>
                        </tr>
                    }
                </tbody>
                <thead><tr><th>#</th><th>Név</th><th>Pont</th></tr></thead>
            </table>
        }
        else
        {
            <h3><span class="glyphicon glyphicon-arrow-left" ></span> Válassz csoportot!</h3>
        }
    </div>

</div>